<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Author: ckmmd 
// +----------------------------------------------------------------------
use think\facade\Route;

/**
 * middleware 额外参数必须传递，不需要则传为 ''
 */

/**
 * 信息认证相关路由
 */

Route::group('',function (){
    Route::post('info_verify/send_email','sendEmail');
    Route::post('info_verify/send_sms','sendSms');
})->prefix('InfoVerify/')
->allowCrossDomain(config('route.cors'));

/**
 * 文件上传路由
 */

Route::group('',function (){
    Route::post('upload/pic','pic');
})->prefix('Upload/')
->allowCrossDomain(config('route.cors'));

/**
 * 登陆路由
 */

Route::group('',function (){
    Route::get('captcha','captcha');
    Route::post('login','login');
    Route::post('login_out','loginOut');
})->prefix('Login/')
->allowCrossDomain(config('route.cors'));

/**
 * 超级用户路由
 */

Route::group('',function (){
    Route::post('super_user/get_super_users','getSuperUsers')->middleware(\app\admin\middleware\Auth::class, 'SuperUser');
    Route::post('super_user/add_super_user','addSuperUser')->middleware(\app\admin\middleware\Auth::class, 'AddSuperUser');
    Route::post('super_user/reset_super_user_pwd','resetSuperUserPwd')->middleware(\app\admin\middleware\Auth::class, 'ResetSuperUserPwd');
    Route::post('super_user/status_super_user','statusSuperUser')->middleware(\app\admin\middleware\Auth::class, 'DelSuperUser');
    Route::post('super_user/set_role','setRole')->middleware(\app\admin\middleware\Auth::class, 'SetRole');
    Route::post('super_user/get_super_user_info','getSuperUserInfo')->middleware(\app\admin\middleware\Auth::class, 'SuperUserCenter');
    Route::post('super_user/save_avatar','saveAvatar')->middleware(\app\admin\middleware\Auth::class, 'SuperUserCenter');
    Route::post('super_user/save_super_user_info','saveSuperUserInfo')->middleware(\app\admin\middleware\Auth::class, 'SuperUserCenter');
    Route::post('super_user/get_super_user_bind_account','getSuperUserBindAccount')->middleware(\app\admin\middleware\Auth::class, 'SuperUserCenter');
    Route::post('super_user/save_super_user_email','saveSuperUserEmail')->middleware(\app\admin\middleware\Auth::class, 'SuperUserCenter');
})->prefix('SuperUser/')
->allowCrossDomain(config('route.cors'));

/**
 * 角色路由
 */

Route::group('',function (){
    Route::post('role/get_roles','getRoles')->middleware(\app\admin\middleware\Auth::class, 'Role');
    Route::post('role/add_role','addRole')->middleware(\app\admin\middleware\Auth::class, 'AddRole');
    Route::post('role/edit_role','editRole')->middleware(\app\admin\middleware\Auth::class, 'EditRole');
    Route::post('role/status_role','statusRole')->middleware(\app\admin\middleware\Auth::class, 'DelRole');
    Route::post('role/auth_role','authRole')->middleware(\app\admin\middleware\Auth::class, 'AuthRole');
})->prefix('Role/')
->allowCrossDomain(config('route.cors'));

/**
 * 菜单权限路由
 */

Route::group('',function (){
    Route::post('menu/add_menu','addMenu')->middleware(\app\admin\middleware\Auth::class, 'AddMenu');
    Route::post('menu/edit_menu','editMenu')->middleware(\app\admin\middleware\Auth::class, 'EditMenu');
    Route::post('menu/status_menu','statusMenu')->middleware(\app\admin\middleware\Auth::class, 'DelMenu');
    Route::get('menu/get_menus','getMenus')->middleware(\app\admin\middleware\Auth::class, 'Menu');
    Route::get('menu/get_all_menus','getAllMenus')->middleware(\app\admin\middleware\Auth::class, 'Menu');
    Route::get('menu/get_menus_by_role','getMenusByRole')->middleware(\app\admin\middleware\Auth::class, '');
    Route::get('menu/get_vue_routes','getVueRoutes')->middleware(\app\admin\middleware\Auth::class, 'Menu');
    Route::get('menu/get_vue_routes_by_role','getVueRoutesByRole')->middleware(\app\admin\middleware\Auth::class, '');
})->prefix('Menu/')
->allowCrossDomain(config('route.cors'));

/**
 * 绝粪用户路由
 */
Route::group('',function (){
    Route::post('jf/user/get_jf_users','getJfUsers')->middleware(\app\admin\middleware\Auth::class, 'JfUser');
    Route::post('jf/user/status_jf_user','statusJfUser')->middleware(\app\admin\middleware\Auth::class, 'DelJfUser');
})->prefix('JfUser/')
->allowCrossDomain(config('route.cors'));

/**
 * 绝粪文章路由
 */
Route::group('',function (){
    Route::post('jf/article/get_jf_articles','getJfArticles')->middleware(\app\admin\middleware\Auth::class, 'JfArticle');
    Route::post('jf/article/audit_status_jf_article','auditStatusJfArticle')->middleware(\app\admin\middleware\Auth::class, 'auditStatusJfArticle');
})->prefix('JfArticle/')
->allowCrossDomain(config('route.cors'));
